import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Test1 {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("f:/tt.txt")) {
            byte[] array = new byte[1024];
            int n = inputStream.read(array) ;
            System.out.println("读了几个字节:"+n);
            for (int i = 0; i < n; i++) {
                System.out.printf("%x\n" , array[i]);    //一般使用16进程来,打印1个字节的数据
            }
        } catch (IOException e) {
              e.printStackTrace();
        }

    }
}
